#pragma once

#include "resource.h"
#include "shellapi.h"
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/imgcodecs.hpp>

/* Service states */
#define STATE_IDLE				0
#define STATE_INITIALISING		1
#define STATE_OBJ_MOVING		2
#define STATE_OBJ_STOPPED		3
#define STATE_ERROR				4
/* Capture/calibration modes */
#define CAPTURE_MODE			100
#define STEREO_CALIBRATE_MODE	101
#define TRACKING_CALIBRATE_MODE	102
#define MOTION_CALIBRATE_MODE	103
#define STOP_MODE				104
/* Camera View */
#define	LEFT_CAMERA_VIEW		1000
#define	RIGHT_CAMERA_VIEW		1001
#define	MERGED_CAMERA_VIEW		1002

#define WM_TRAYICON				WM_APP+100

ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);
HRESULT             CaptureFrame();
HRESULT             InitializeCapture();
void	            CalibrateStereo();
void				CalibrateTracking();
void				CalibrateMotion();
void				LoadConfig();
void				SaveConfig();
void				StartCapturing();
void				AbortCapturing();
void				SetViewCam(int);
void				SetMode(int);
void				SetColors(int);
void				GetColors(int);
void				UpdateHSVTrackbars();
void				SetStatus(const TCHAR*);
void				SetIcon(int);
void				SetCoeff();
void				SendMsg(const char*);
cv::Point           detectCircles(cv::Mat, cv::Vec3b, cv::Vec3b);
cv::Point           detectContours(cv::Mat, cv::Vec3b, cv::Vec3b, int, int);

